Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-core-module

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-core-module

Is this specifier a node.js core module?

  • 2.15.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is is-core-module?

The is-core-module package is a simple utility that allows developers to check if a given module name corresponds to a Node.js core module. Core modules are modules that are included with Node.js itself, such as 'http', 'fs', and 'path'. This package is particularly useful when building tools that need to differentiate between core modules and third-party modules.

What are is-core-module's main functionalities?

Check if a module is a core module

This feature allows you to check if a string corresponds to a Node.js core module. It returns true if the module is a core module, and false otherwise.

const isCoreModule = require('is-core-module');

console.log(isCoreModule('fs')); // true
console.log(isCoreModule('express')); // false

Check if a module is a core module with a specific Node.js version

This feature allows you to check if a module is a core module in a specific version of Node.js. This is useful when dealing with different Node.js versions that may have different sets of core modules.

const isCoreModule = require('is-core-module');

console.log(isCoreModule('fs', { version: '8.0.0' })); // true
console.log(isCoreModule('http2', { version: '8.0.0' })); // false

Other packages similar to is-core-module

Keywords

FAQs

Package last updated on 21 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc